version: '3.8'

services:
  db:
    image: "postgres"
    container_name: "${DB_NAME}-db"
    restart: always
    command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
    environment:
      TZ: "Europe/Moscow"
      POSTGRES_DB: "${DB_NAME}"
      POSTGRES_USER: "${DB_USER}"
      POSTGRES_PASSWORD: "${DB_PASSWORD}"
    volumes:
      - "./db/postgresql-data:/var/lib/postgresql/data" 
    ports:
      - "8888:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      start_period: "5s"
      interval: "10s"
      timeout: "30s"
      retries: 3